﻿using System.ComponentModel.DataAnnotations;

namespace Faser_Shop.Models.RequestModel
{
    public class AddToShoppingCartRM
    {
        [Required(ErrorMessage = "商品Id不能为空")]
        public int ProductId { get; set; }

        /// <summary>
        /// 添加的购物车商品数量
        /// </summary>
        /// <example>1</example>
        [Required(ErrorMessage = "商品数量不能为空")]
        [Range(1, int.MaxValue, ErrorMessage = "商品数量必须大于0")]
        public int ProductQuantity { get; set; } = 1;
    }
}